<template>
  <div class="DiscussionList">
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '' }">病例探讨管理</el-breadcrumb-item>
      <el-breadcrumb-item :to="{ path: '/discussion' }"
      >病例探讨管理
      </el-breadcrumb-item
      >
    </el-breadcrumb>
    <div class="hospitalMain">
      <!--      搜索部分-->
      <div class="hospitalMain-top">
        <!--        搜索-->
        <div class="hospitalMain-search">
          <div class="search">
            探讨名称:
            <el-input
                placeholder="请输入内容"
                v-model="input1"
                clearable
            ></el-input>
          </div>
          <div class="search">
            主持人:
            <el-input
                placeholder="请输入内容"
                v-model="input2"
                clearable
            ></el-input>
          </div>
          <div class="search">
            报名开始时间：
            <el-date-picker
                v-model="value1"
                type="date"
                placeholder="选择日期">
            </el-date-picker>
          </div>
          <div class="search">
            报名结束时间：
            <el-date-picker
                v-model="value2"
                type="date"
                placeholder="选择日期">
            </el-date-picker>
          </div>
          <div class="search">
            取消时间：
            <el-date-picker
                v-model="value3"
                type="date"
                placeholder="选择日期">
            </el-date-picker>
          </div>
          <div class="search">
            探讨状态:
            <template>
              <el-select v-model="value" clearable placeholder="请选择">
                <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                ></el-option>
              </el-select>
            </template>
          </div>
          <div class="search">
            探讨开始时间：
            <el-date-picker
                v-model="value4"
                type="date"
                placeholder="选择日期">
            </el-date-picker>
          </div>
          <div class="search">
            <div></div>
            <div>
              <el-button>重置</el-button>
              <el-button type="primary">搜索</el-button>
            </div>
          </div>
        </div>
        <div></div>
      </div>

      <div class="name_add">
        <div><h3>活动列表</h3></div>
        <div>
          <!--点后弹出弹窗-->
          <el-form :inline="true">
            <el-form-item>
              <el-button type="primary" @click="showConfirmCodeDialog">新增探讨</el-button>
            </el-form-item>
          </el-form>
          <!--弹出的弹窗内容-->
          <el-dialog title="新增病历探讨" :visible.sync="dialogVisible" center width="40%">
            <div style="display: flex;flex-direction: column;align-items: center;justify-content: center;">
              <el-form>
                探讨主题：
                <el-form-item>
                  <el-input v-model="secureCode1" placeholder="请输入" clearable></el-input>
                </el-form-item>
                参会医生：
                <el-form-item>
                  <el-input v-model="secureCode2" placeholder="请输入" clearable></el-input>
                </el-form-item>
                <div></div>
                主持人：
                <el-form-item>
                  <el-input v-model="secureCode3" placeholder="请输入" clearable></el-input>
                </el-form-item>
                探讨持续时间：
                <el-date-picker style="margin-bottom: 22px;"
                                v-model="value4"
                                type="date"
                                placeholder="选择日期">
                </el-date-picker>
                <div></div>
                探讨开始时间：
                <el-date-picker style="margin-bottom: 22px;"
                                v-model="value5"
                                type="date"
                                placeholder="选择日期">
                </el-date-picker>
                <div></div>
                报名开始时间：
                <el-date-picker style="margin-bottom: 20px;"
                                v-model="value6"
                                type="date"
                                placeholder="选择日期">
                </el-date-picker>
                <div></div>
                报名结束时间：
                <el-form-item>
                  <el-input v-model="secureCode4" placeholder="分钟" clearable></el-input>
                </el-form-item>
                患教费用：
                <el-form-item>
                  <el-input v-model="secureCode5" placeholder="核桃币" clearable></el-input>
                </el-form-item>
                探讨说明：
                <el-input
                    type="textarea"
                    :autosize="{ minRows: 2, maxRows: 4}"
                    placeholder="请输入内容"
                    v-model="textarea2">
                </el-input>
              </el-form>

            </div>
            <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="open()">确定</el-button>
      </span>
          </el-dialog>
        </div>
      </div>
      <!--    表格-->
      <template>
        <el-table :data="diccussionList" style="width: 100%">
          <el-table-column label="探讨名称" >
            <template slot-scope="scope">
              <span style="margin-left: 1px">{{ scope.row.talk_name }}</span> 
            </template>
          </el-table-column>
          <el-table-column label="参加人数">
            <template slot-scope="scope">
              <span style="margin-left: 1px">{{ scope.row.people }}</span>
            </template>
          </el-table-column>
          <el-table-column label="探讨开始时间" >
            <template slot-scope="scope">
              <span style="margin-left: 1px">{{ scope.row.talk_staTime }}</span>
            </template>
          </el-table-column>
          <el-table-column label="报名开始时间" >
            <template slot-scope="scope">
              <span style="margin-left: 1px">{{ scope.row.talk_sigstaTime }}</span>
            </template>
          </el-table-column>
          <el-table-column label="报名结束时间" >
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.talk_sigoverTime }}</span>
            </template>
          </el-table-column>
          <el-table-column label="参会金额" >
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.talk_money }}</span>
            </template>
          </el-table-column>
          
          <el-table-column label="邀请嘉宾" >
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.invite }}</span>
            </template>
          </el-table-column>
          
          
          
          <el-table-column label="结束时间" >
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.talk_overTime }}</span>
            </template>
          </el-table-column>
          
          <el-table-column label="操作">
            <template slot-scope="scope">
              <el-button size="mini" type="text" @click="showHosMsg(scope.row)"
              >查看

              </el-button>
              <el-button
                  size="mini" type="text"
                  @click="handlePass(scope.$index, scope.row)"
              >通过
              </el-button>
              <el-button
                  size="mini" type="text"
                  @click="dellist(scope.row.talk_id)"
               
              >取消
              </el-button>
            </template>
          </el-table-column>
        </el-table>
      </template>
      <!--    页码-->
<<<<<<< Updated upstream
      <!-- <el-pagination background
                     layout="prev, pager, next"
                     :total="disCount"
                     :current-page="Number(page)"
                     :page-size="Number(size)
                     @size-change="
                     handleSizeChange"
                     @current-change="handleCurrentChange"></el-pagination> -->
      <el-pagination background
                     layout="prev, pager, next"
                     :total="discount"
                     :current-page="Number(page)"
                     :page-size="Number(size)"
                     @size-change="handleSizeChange"
                     @current-change="handleCurrentChange"></el-pagination>

=======
      <el-pagination
          background
          layout="prev, pager, next"
          :total="disCount"  @current-change="getPageNumBtn" :current-page="currentPage" :page-size="limitSize"
      ></el-pagination>
>>>>>>> Stashed changes
    </div>
  </div>
</template>

<script>
import axios from 'axios';
export default {
  name: "DiscussionList",
  data() {
    return {
      
disList: [],
diccussionList:[],
      disCount: 120,
      limitSize: 10,//每页显示条数
      currentPage: 1,//当前页码
<<<<<<< Updated upstream
      obj: {//新增数据信息
        hname: '',
        iname: '',
        talk_conTime: '',
        talk_details: '',
        talk_money: '',
        talk_name: '',
        talk_sigoverTime: "",
        talk_sigstaTime: '',
        talk_staTime: '',
        uname: '',
        secureCode1: ''
      },
      size: '5',
      page: '1',
      discount: 0,
=======

>>>>>>> Stashed changes
      value1: "",
      value2: "",
      value3: "",
      value4: "",
      input1: "",
      input2: "",
      //弹出输入框
      dialogVisible: false,
      secureCode: "",
      
      options: [
        {
          value: "选项1",
          label: "未开始",
        },
        {
          value: "选项2",
          label: "已开始",
        },
        {
          value: "选项3",
          label: "已取消",
        },
        {
          value: "选项4",
          label: "已结束",
        },
      ],
      value: "",
    };
  },
  mounted() {
    this.getDiscussionList();
  },
  methods: {
    handleSizeChange (val) {
      this.size = val
      console.log(`每页 ${val}条`);
      this.diccussionList.splice(0)
      this.getdiscussionList();
    },
    handleCurrentChange (val) {
      this.diccussionList.splice(0)
      this.page = val
      console.log(`当前页: ${val}`);
      this.getdiscussionList()
    },

    //删除
    dellist(talk_id){
      
    },



     getPageNumBtn(val) {//获取当前点击的页码
      this.currentPage = val;
<<<<<<< Updated upstream
      this.getdiscussionList(this.size, this.page);
    },
    // 获取病例探讨列表
    getdiscussionList () {
      this.$service.discussionService.getdiscussionList(this.size, this.page).then(res => {
        this.diccussionList = res.data.data.maps;
        this.discount = res.data.data.integer
        console.log(1111, res)
=======
      this.getDiscussionList(this.limitSize,this.currentPage);
    },
    // 获取病例探讨列表
    getDiscussionList(){
      this.$service.discussionService.getDiscussionList( this.limitSize,this.currentPage).then(res=>{
        // console.log(res)
        this.diccussionList=res.data.data.maps;
        console.log(this.diccussionList);
>>>>>>> Stashed changes
      })
    },





    //查看医院信息
    showHosMsg(hosRow) {
      console.log(hosRow);
      this.$router.push('/checkdiscussion');
    },
    showConfirmCodeDialog() {
      this.dialogVisible = true;//显示弹窗
    },
    open() {

      this.$confirm('是否保存?', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'primary'
      }).then(() => {
        this.$message({
          type: 'success',
          message: '保存成功!'

        });
        this.dialogVisible = false;//显示弹窗
      })

    }
  },
};
</script>

<style scoped lang="less">
.hospitalMain {
  display: flex;
  flex-direction: column;

  .hospitalMain-top {
    display: flex;
    justify-content: space-between;
    
    margin: 10px 0;

    .hospitalMain-search {
      margin-right: 20px;
      display: flex;
      
      flex-wrap: wrap;
      justify-content: space-between;

      .search {
        display: flex;
        margin: 10px 0 10px;        
        align-items: center;
        width: 30%;
        justify-content: space-between;
        .el-input,
        .el-select {
          width: 75%;
        }
      }
    }
  }

  .name_add {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
  }

  .el-pagination {
    margin-top: 10px;
  }
}
</style>

